package com.it.code.service;

import com.it.CodeApplication;
import com.it.code.build.TemplateBuilder;
import com.it.code.swagger.SwaggerModel;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.generator.api.MyBatisGenerator;
import org.mybatis.generator.config.Configuration;
import org.mybatis.generator.config.xml.ConfigurationParser;
import org.mybatis.generator.exception.XMLParserException;
import org.mybatis.generator.internal.DefaultShellCallback;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: CodeService
 * @description: 代码生成器 具体实现
 * @author: 李东
 * @Date: 2020-7-20 11:52
 */
@Slf4j
@Service
public class CodeService {

    @Transactional(rollbackFor = Throwable.class)
    public String runCode() throws Exception {

        /****************************** 代码生成 ****************************/

        log.info("代码生成器，开始生成代码,请稍等！");

        TemplateBuilder.builder();

        log.info("代码生成器，生成代码结束,谢谢使用！");

        return "SUCCESS";
    }



}
